#include <allegro.h>
#include <stdio.h>
#include "stage.h"
#include "sound.h"
#include "object.h"

stage::stage(char* stage_file) {
	FILE* fp_stage;

	fp_stage = fopen(stage_file, "r");

	char music_fname[100];
	fscanf(fp_stage, "%s", music_fname);

	this->music = new sound(music_fname);

	char notes_img_fname[100];
	fscanf(fp_stage, "%s", notes_img_fname);

	this->notes_img = load_bitmap(notes_img_fname, NULL);

	int seconds;
	int x;
	int speed_y;

	while (fscanf(fp_stage, "%d, %d, %d", &seconds, &x, &speed_y) != EOF) {
		this->notes.push_back(object(seconds, x, speed_y, this->notes_img));
	}
}

